package com.cskaoyan.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@EnableWebMvc/*这两个注解都可以当springmvc的配置类*/
//EnableWebMvc->全面接管springmvc的配置
//Configuration做补充

/**
 * @author: lds lsy
 * @clsss: MvcConfiguration
 * @description: 增加了一个allowedHeaders
 */
//@Configuration
public class MvcConfiguration implements WebMvcConfigurer {
    @Override
    public void addCorsMappings(CorsRegistry registry) {

        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedHeaders("*")
                .allowedMethods("*");

    }
}
